package com.none.usercenter.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.none.usercenter.model.domain.User;
import jakarta.servlet.http.HttpServletRequest;

import java.util.List;

/**
* @author xiaofeng
* @description 针对表【user(user)】的数据库操作Service
* @createDate 2025-10-14 23:07:05
*/
public interface UserService extends IService<User> {
    /**
     * 用户注册
     * @param userAccount 用户账户
     * @param password  用户密码
     * @param checkPassword 校验密码
     * @return
     */
    long userRegister(String userAccount, String password,String checkPassword,String planetCode);

    /**
     * 用户登录
     * @param userAccount 用户账号
     * @param password 用户密码
     * @return
     */
    User dologin(String userAccount, String password, HttpServletRequest request);

    /**
     * 用户脱敏
     * @param originalUser
     * @return
     */
    User getSafetyUser(User originalUser);

    /**
     * 用户注销
     * @param request
     * @return
     */
     int userLginOut(HttpServletRequest request);

    /**
     * 根据标签搜索用户
     */
    List<User> searchUserByTags(List<String> tagNameList);

    /**
     * 更新用户信息
     * @param user
     * @return
     */
    int updateUser(User user,User loginUser);

    /**
     * 获取当前登录用户信息
     * @param request
     * @return
     */
    User getLoginUser(HttpServletRequest request);

    boolean isAdmin(HttpServletRequest request);

    boolean isAdmin(User user);

    List<User> matchUsers(long num, User loginUser);
}
